Chris Pollett > Old Classes >
CS174

( Print View )

Student Corner:
  [Grades Sec1]
  [Grades Sec2]

  [Submit Sec1]
  [Submit Sec2]

  [Class Sign Up Sec1]
  [Class Sign Up Sec2]

  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Hw6]

Practice Exams:
  [Mid1]  [Final]

                           












HW#3 --- last modified February 28 2019 22:28:38..

Solution set.

Due date: Oct 20

Files to be submitted:
  Hw3.zip

Purpose: To gain more familiarity with designing web-sites using the MVC pattern, this time, actually using object-orientation. To learn how to code accessing a database from a web script. To gain experience with using PHP sessions. To practice doing client-side form validation.

Related Course Outcomes:

The main course outcomes covered by this assignment are:

(1) [Write HTML documents containing standard HTML elements including forms, tables, client-side scripts, and server-side scripts].

(3) [Write server-side scripts that process HTML forms].

(4) [Write client-side scripts that validate HTML forms].

(5) [Develop and deploy web applications that involve components, web services, and databases].

Specification:

For this homework you will create a simple, web-based, bulletin board site. Examples of existing products which provide this functionality (and more than you need to do for this assignment) include vBulletin or Google Groups.

To grade your homework the grader will do the following: (1) unzip your Hw3.zip file under document root, (2) look for a config subfolder enter it, (3) copy the file config.php.default to config.php and modify its contents per the instructions inside so the program should run on the grader's instance of apache, (4) look in this same folder for a file Hw3.sql, which should have the sql needed to set up all of your database tables, (5) launch the command-line mysql client and type:

\. Hw3.sql

to run this script. At which point the grader will begin testing your project for the functionalities indicated below.

Your web-site should support the following features: (1) Users should be able to create accounts, log-in and sign-off; (2) users are remembered for up to an hour after coming to the site/signing-in and they can select and have remembered the CSS theme of the site; (3) the site should support an admin account which has the ability to create/delete/edit forums and create/edit/delete any user's posts, (4) the site should allow non-logged-in or logged-in users to see what forums are available and to select a forum to read posts; (5) the site should allow non-logged-in or logged-in users to read a given forums posts; (6) the site should allow a logged-in user to create a new post; (7) the site should support being able to view posts in both a usual screen format as well as a format optimized for PDAs or cell-phone browsers. That is, both views should be in HTML (no WML please!) but the latter should be optimized for a small screen.

Here are some additional requirements: (a) You maintain user account info, forum info, and post info in a mysql database named bulletinboard; (b) (2) above should be implemented using PHP sessions; (c) all requests to your site should go through the index.php file in the Hw3 folder. This folder should have three subfolders one for controllers, one for models, one for views. The variable c in the query string should control which controller is used; the variable v should control the view; (d) your controllers and models should be implemented using PHP classes. The information returned from model methods should be objects built out of table rows from the DB. You should have separate controllers for at least creating an account, admin operations, posting, reading posts.

Point Breakdown

Set-up process as described results in a site that is running for grader 1pt
Features listed above (1pt each) 7pts
Additional requirements (1/2pt each) 2pts
Total10pts